package com.cskaoyan.day15;

public class WordTest {
    public static void main(String[] args) {
        int count = 0;
        String statement = "peter piper picked a peck of pickled peppers";
        String[] words = statement.split(" ");
        for (String word : words) {
            if (word.startsWith("p")) {
                count++;
            }
        }
        System.out.println("peter piper picked a peck of pickled peppers这句话有" + count + "个以p开头的单词");
    }
}

